Attribute Sorter and Copier v.6

by Linda McGrath osCOMMERCE@WebMakers.com
Updates: Robin Dunlop and Kiril Nedelchev

 

used for

Attribute Suite v.1.2.3

by Kiril Nedelchev <kikoleppard@hotmail.bg>

August, 1 , 2005 - MODIFIED for Attribute Suite v.1.2.3

- you can sort the options in New Attribute Manger or Single Attribute Manager.

- compatibility with Option Type Feature v.1.7.1. - for all option types in catalog/product_info.php

view catalog/product_info.php

- removed all the Client's add-on from Attribute Sorter and Copier v.5b like:

 

Sorter for product_info.php - //1= sort by products_options_sort_order + name; 0= sort by products_options_sort_order + price and

 

Categories Image and Name on product_info.php

 

- added Sort Order for Product Options and Option Values in product_info.php

 

- added full multilanguage support

Donations are always appreciated: PayPal@WebMakers.com
Version 5.0->5.1 changes made by Robin Dunlop (contact via forum members).
============================================================================
Notes: The files in this contribution are all based on the osCommerce 2.2MS2 version of the individual files.
From a clean install, you can just replace the files with these ones. If you've made changes to the files, use a diff program to compare the changes and help merge in this contribution.

Nearly all the code changes made during this contribution have been commented with BOF/EOF syntax. (Beginning Of Fix/End Of Fix). The only parts that I consciously didn't put these tags are where the change was very minor, and often recurring.

============================================================================
Installation Instructions
----------------------------------------------------------------------------
1) BACK UP ALL YOUR FILES/DATA. Don't delete/replace files, copy them first.
2) run the sql statements in change.sql (using your mysql interface of choice).
3) copy all the files from these directories into the parallel directory on your server.
- Run diff checks to see that you haven't made additional changes to those files.

============================================================================

Providing no one abuses the priveledge, the website for testing this is located at:

Catalog:
http://www.thewebmakerscorner.com/snap_attributes

Admin:
http://www.thewebmakerscorner.com/snap_attributes/admin

Thanks to David Garcia Watkins for the original Attribute Enhancer, and to Matthijs vd Vegte for the original Quickly De-Activate Products.

Based on MS2 release: osCommerce2.2MS2 (not a CVS snapshot, a "release")

============================================================================
Version 5.1b:
Changes from Version 5.1a:
-Same as 5.1a, but removed all the Coming Soon code including:
- Product Attributes: One Time Charge, Attribute Weight, Weight Prefix, Units, Unit Price - removed for Attribute Suite v.1.2.2
- Added a sort order to the Option Values table.
- This means that you only have to specify the sort order once for each Option Value possibility.
- When you add a new "Option Value" to the Product Attributes table, the Sort order defined will be copied
- This means that you will have a common sort order for your products, but you can tweak individual products if you need to change their sort order (to set the default selected attributes for example).
============================================================================
Version 5.1a
Changes from Version 5.0:
- Removed sort-order from Product Option since it is now sorted by product_option name in the official version.
- Updated the product_info.php file to be based on the v1.97 release (was based on v1.87)
- Updated the product_attributes.php to be based on v1.52 release (was based on v1.48)
- also removed the Product-option sort order change option (since field is now removed)
- fixed a few code errors that were present in the patch
- DISCLAIMER: I don't claim that the "COMING SOON" code works as well as before, I tried to keep the functionality that was there in the patch, but since this functionality was incomplete, I didn't work too hard on that.

- Added a change.sql file that has all the sql commands, removed them from this README
- removed the sql commands that added the products_options_sort_order
- Updated the directory structure/files to be exactly what an out-of-box 2.2MS2 has.

============================================================================

WHAT DOES THIS DO?
This add-on is designed to ...

Allow you to copy attributes from:

1 Existing Product to Duplicate Product
2 Existing Product to Existing Product
3 Existing Product to ALL Products in a Category

Adds Option Values Sort Order so attribute option values are displayed in the same order regardless of how they are added (assuming non-0 sort order values set for each Option Value before adding Attributes to products).
- When adding a new option value to a product, if no sort_order is specified, the sort_order of the option_value is used.

============================================================================

TABLE CHANGES:
WARNING: Be sure to BACKUP all of your files before copying, editing, etc.

See changes.sql file for SQL ALTER statements

============================================================================

FILE CHANGES AND ADDITIONS
All file changes and new additions are located in folders to match the /catalog and /admin structure

WARNING: Be sure to BACKUP all of your files before copying, editing, etc.

Beyond Compare is a great program to use if you need to update your files manually due to other add-ons.

============================================================================

Step 1.

LANGUAGE FILE:
Language file changes are to all languages. They are defined here for english but need to be done on each language you use.

-------------------------------------------
At the very bottom of:
Filename: /admin/includes/languages/english.php

Added:
(a lot, see the file)

// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
require(DIR_WS_LANGUAGES . $language . '/' . 'attribute_sorter_copier.php');

define('IMAGE_EDIT_ATTRIBUTES', 'Edit Attributes');

============================================================================

Step 2.

APPLICATION_TOP changes:
Add just before the ?> at the very bottom of:

Filename: /admin/includes/application_top.php

// WebMakers.com Added: Includes Functions for Attribute Sorter and Copier
require(DIR_WS_FUNCTIONS . 'webmakers_added_functions.php');

============================================================================

Step 3.

FUNCTIONS
The /admin/includes/functions/webmakers_added_functions.php has new functions used in a few parts of this addition.

WARNING: If you already have a file called /admin/includes/functions/webmakers_added_functions.php from a previous add-on, you need to edit this file and Cut & Paste the new functions into your existing file.

============================================================================

Step. 4

JAVA SCRIPTS
The Java Scripts are handled by an include statements.

Copy into the Admin directory to the proper folder:
/admin/includes/javascript/webmakers_added_js.php

============================================================================

Step 5.

SUMMARY OF FILE CHANGES TO OVERWRITE OR UPDATE WITH NEW CHANGES:
BACKUP! BACKUP! BACKUP! BACKUP! BACKUP!

Be sure to backup all files before editing or overwritting these files.

Beyond Compare is a handy tool for inserting changes if you have already made previous changes to these files.

If you have never modified these files, they can be over written.

/admin/categories.php
/admin/includes/application_top.php
/admin/includes/header.php
/admin/includes/languages/english.php

============================================================================

Step 6.

NEW FILES:
These files just get copied into the proper directories.

/admin/quick_products_popup.php
/admin/quick_attributes_popup.php
/admin/includes/functions/webmakers_added_functions.php - update to application_top.php listed above
/admin/includes/javascript/webmakers_added_js.php
/admin/includes/languages/english/attribute_sorter_copier.php

============================================================================

Please let me know if you find any bugs or have other needs related to the Attributes Sorter and Copier Add-on

 

Go to Step b.1.6 - Actual Atribute Price v.1.4.1

Go to the mainpage